home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1998 March
/
Macworld (1998-03) (Disk 1).dmg
/
Shareware World
/
Info
/
For Developers
/
GhostScript 5.10
/
AppleScripts
/
ps2jpeg.txt
< prev
next >
Wrap
Text File
|
1997-12-25
|
1KB
|
38 lines
on open fileDropList
set theCount to count of fileDropList
set filesProcessed to 0
tell application "MacGS-510 FAT" to activate
repeat with i from 1 to theCount
set theFile to item i of fileDropList as alias
set theInfo to info for theFile
set theType to file type of theInfo
set theFileName to item i of fileDropList as string
if theType = "PDF " or theType = "TEXT" or theType = "EPSF" then
ProcessFiles(theFileName)
set filesProcessed to filesProcessed + 1
end if
end repeat
if filesProcessed > 0 then
if filesProcessed is equal to 1 then
set resultString to "One file was processed."
else
set resultString to {theCount, " files were processed."} as string
end if
else
set resultString to {"No files were processed."} as string
end if
display dialog resultString buttons "OK" with icon 1 default button 1
end open
on ProcessFiles(theFile)
set theCommandLine to {"-q -sDEVICE=jpeg -r300 -sOutputFile=\"", theFile, "%d.jpeg\" \"", theFile, "\" -c quit"} as string
tell application "MacGS-510 FAT"
«event gsVRexec» theCommandLine
end tell
end ProcessFiles
on run
set theFile to (choose file of type {"TEXT", "EPSF", "PDF "}) as string
ProcessFiles(theFile)
end run